using Microsoft.EntityFrameworkCore;
using OData.Shared.Models;

namespace OData.Data;

public class ApplicationDbContext(
    DbContextOptions<ApplicationDbContext> options
    ) : DbContext(options)
{
    public DbSet<Customer> Customers => Set<Customer>();
    public DbSet<Address> Addresses => Set<Address>();
    public DbSet<Product> Products => Set<Product>();
    public DbSet<Order> Orders => Set<Order>();
    public DbSet<LineItem> LineItems => Set<LineItem>();
    
    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
	    modelBuilder.ApplyConfigurationsFromAssembly(typeof(ApplicationDbContext).Assembly);
	    base.OnModelCreating(modelBuilder);
    }
}
